package com.ssm.zhihu_ssm.dao;

import com.ssm.zhihu_ssm.entity.Answer;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface AnswerDao {
//    List<Answer> getAnswerByUserId(int id);//根据用户id得到用户所有问题
    void insertAnswer(int uid, int question_id, String content);//写回答
    void collectAnswer(int uid, int answer_id);//用户收藏回答
    void addCollectAnswer(int answer_id);//用户收藏回答数加1
    void addAnswerGoodNumByAnswerId(int answer_id);//给回答点赞+1
    void addAnswerBadNumByAnswerId(int answer_id);//给回答点踩+1
    void minusAnswerGoodNumByAnswerId(int answer_id);//给回答点赞-1
    void minusAnswerBadNumByAnswerId(int answer_id);//给回答点踩-1
    List<Answer> getAnswerByAnswerId(int answer_id);//根据回答id得到回答
    List<Answer> getAnswerByQuestionId(int question_id);//根据问题id得到所有回答
    List<Answer> getAnswerByClassifyId(int classify_id);//根据主题id得到所有回答
    List<Answer> getAllAnswer();//后台
    void deleteAnswerByAnswerId(int id);//后台
}